SELECT subject,cabinet,time FROM monday NATURAL LEFT JOIN cabinets NATURAL LEFT JOIN time LEFT JOIN subjects ON monday.id_odd = subjects.id;